#ifndef IMAGEUPLOAD_H
#define IMAGEUPLOAD_H

#include <QObject>
#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkRequest>
#include <QtNetwork/QNetworkReply>
#include <QFile>
#include <QFileInfo>
#include <QDesktopServices>
#include <QPicture>
#include <QTime>
#include <QClipboard>
#include <QVector>
#include <QSettings>

#include <QDebug>

namespace Image {

class Uploader : public QObject
{
    Q_OBJECT
public:
    explicit Uploader(QObject *parent = 0);

    static Uploader* instance(QObject *parent = 0);

public:
    void upload();
    void parserImage(QByteArray message);
    
signals:
    void sendPhotoUrl(QString url);
    void setPhoto();
    
public slots:
    void onUpload();

public:
    void setFilePath(QString filePath);

    const QString &filePath() const {
        return m_filePath;
    }
private:
    static Uploader *m_instance;
    QString m_filePath;
    
    QNetworkAccessManager *http;
    QVector<QNetworkReply *> reps;
};

}

#endif // IMAGEUPLOAD_H
